package cz.cernilovsky.android.profileapp.activities;

import java.io.IOException;
import java.io.Serializable;

import org.json.JSONException;

import cz.cernilovsky.android.profileapp.R;
import cz.cernilovsky.android.profileapp.storage.ProfilesStorage;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import android.widget.FrameLayout;

public class ProfilesActivity extends FragmentActivity {

	@Override
	protected void onCreate(Bundle savedInstance) {
		super.onCreate(savedInstance);
		/*try {
			loadProfiles();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}*/
		setContentView(R.layout.activity_profiles);
	}
	
	public void addProfile(View view) {
		Intent i = new Intent(this, AddProfileActivity.class);
		startActivity(i);
	}
	
	/*private void loadProfiles() throws IOException, JSONException {
		ProfilesFragmentListActivity result = (ProfilesFragmentListActivity) getFragmentManager().findFragmentById(R.id.profileFragment);
		if (result == null) {
			result = new ProfilesFragmentListActivity();
			Bundle args = new Bundle();
			args.putSerializable(ProfilesFragmentListActivity.PROFILES, (Serializable) ProfilesService.loadProfiles(this));
			result.setArguments(args);
			FragmentTransaction ft = getFragmentManager()
					.beginTransaction();
			ft.add(R.id.profileFragment, result);
			//ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
			int r = ft.commit();
			System.out.println("Replaced " + r);
		}
	}*/
	
}
